package algebra.op;

import java.util.List;

import entities.ConceptAssertion;
import entities.vocabulary.Display;
import algebra.ProjectionDescription;
import algebra.visitors.ProjectionQueryVisitorEvaluator;

public class ProjectionQuery extends Query{
	private ProjectionDescription pd;
	private Query sub;
	
	public ProjectionQuery(ProjectionDescription pd, Query sub){
		this.pd = pd;
		this.sub = sub;
	}
	
	public List<ConceptAssertion> acceptVisitor(ProjectionQueryVisitorEvaluator eval) {
		return eval.visit(this);
	}
	
	public Query getSubquery(){
		return this.sub;
	}
	
	public ProjectionDescription getPrjDesc(){
		return this.pd;
	}
	
	@Override
	public boolean isPure() {
		// TODO Auto-generated method stub
		return sub.isPure();
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return Display.QPROJECTIONUNICODE+"_"+this.pd.toString()+"_("+this.sub.toString()+")";
	}
	
	
}
